//1.日志和评论一起查，弃用
select user.user_name,log.log_id,log.log_content,comment.comment_content,comment.comment_id from log,comment,user where log.log_id = comment.log_id and comment.user_id = user.user_id;

//2.查询日志和发表者
select log.log_id , log.log_content , user.user_name , user.user_id from log,user where log.user_id = user.user_id;

//3.点击评论再生成评论
select A.*,B.user_name from comment A,user B where A.log_id=log_id and A.user_id = B.user_id;

//4.根据日志查询评论数
SELECT log_id, COUNT(*) FROM comment GROUP BY log_id;

//5.把2和4融合到一起，查询日志、发表者、评论数
select a.*,b.com_num from (select log.log_id , log.log_content , user.user_name , user.user_id from log, user where log.user_id = user.user_id) a left join (select log_id, count(*) com_num from comment group by log_id) b on a.log_id = b.log_id